public class Dog {//定义一个狗的类

        public String name;
        public String color;
        public int age;
        public void barks(){
            System.out.println(name+"狂吠");
        }
        public  void  wag(){
            System.out.println(age+"摇头");
        }

    public static void main(String[] args) {
        Dog dog= new Dog();
        dog.name="约克";
        dog.color="红";
        dog.age=9;
        System.out.println("姓名  "+dog.name);
        System.out.println("年龄  "+dog.age);
        System.out.println("颜色  "+dog.color);




    }
}
